package yf.mall.vo.web;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderPriceVO {

    //商品总价
    private BigDecimal price = BigDecimal.ZERO;

    //抵扣的优惠券
    private BigDecimal coupon = BigDecimal.ZERO;

    //抵扣的现金券
    private BigDecimal cash = BigDecimal.ZERO;

    //物流费
    private BigDecimal logFee = BigDecimal.ZERO;

    //总件数
    private Integer quantity = 0;

    //实际支付 = 商品总价 - 优惠价格 + 物流费
    private BigDecimal pay = BigDecimal.ZERO;

    public BigDecimal getPay() {
        return price.subtract(coupon).subtract(cash).add(logFee);
    }
}
